"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _video = _interopRequireDefault(require("video.js"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * 初始化视频
 */
function initializePlayer(playerRef, playerOptions) {
  var src = playerOptions.src,
      poster = playerOptions.poster,
      initialTime = playerOptions.initialTime;
  var player = (0, _video.default)(playerRef, playerOptions);
  src && player.src(src);
  poster && player.poster(poster); // 设置视频播放当前时间

  if (initialTime) player.currentTime(initialTime);
  return player;
}

var _default = initializePlayer;
exports.default = _default;